package database.run.test;

import android.test.ActivityInstrumentationTestCase2;
import android.widget.TextView;
import database.run.DatabaseTestActivity;
//import database.run.R;

public class OutputValidation extends ActivityInstrumentationTestCase2 {
	
	private DatabaseTestActivity mActivity;
    private TextView mView;
    private String resourceString;

	public OutputValidation(String name) {
		super("database.run", DatabaseTestActivity.class);
	}

	@Override
	protected void setUp() throws Exception {
		super.setUp();
		
		mActivity = (DatabaseTestActivity) getActivity();
		
		mView = (TextView) mActivity.findViewById(database.run.R.id.textview);        
		resourceString = mActivity.getString(database.run.R.string.hello); 
	}
	
	public void testPreconditions() {
		assertNotNull(mView);
	}

	private static final String Username = "J O C O R C O S ENTER ";
	private static final String Password = "1 2 3 4 ENTER ";
	private static final String FirstName = "J O E Y ENTER ";
	private static final String LastName = "C O R C O S ENTER ";
	private static final String Email = "J O C O R C O S @ G M A I L . C O M ENTER ";
	public void testRegester(){
		sendKeys(Username);
		sendKeys(FirstName);
		sendKeys(LastName);
		sendKeys(Password);
		sendKeys(Password);
		sendKeys(Email);
		sendKeys(Email);
		sendKeys("ENTER");
		
		
	}
	
	private static final String UsernameNULL = "ENTER ";
	private static final String PasswordNULL = "ENTER ";
	private static final String FirstNameNULL = "ENTER ";
	private static final String LastNameNULL = "ENTER ";
	private static final String EmailNULL = "ENTER ";
	public void testRegesterNullValues(){
		sendKeys(UsernameNULL);
		sendKeys(FirstNameNULL);
		sendKeys(LastNameNULL);
		sendKeys(PasswordNULL);
		sendKeys(EmailNULL);
		sendKeys(EmailNULL);
		sendKeys("ENTER");
		
		
	}
	
	public void testRegesterNullUser(){
		sendKeys(UsernameNULL);
		sendKeys(FirstName);
		sendKeys(LastName);
		sendKeys(Password);
		sendKeys(Password);
		sendKeys(Email);
		sendKeys(Email);
		sendKeys("ENTER");
	}
	
	public void testRegesterNullPass(){
		sendKeys(Username);
		sendKeys(FirstName);
		sendKeys(LastName);
		sendKeys(PasswordNULL);
		sendKeys(PasswordNULL);
		sendKeys(Email);
		sendKeys(Email);
		sendKeys("ENTER");
		
		
	}
	
	public void testRegesterNullFName(){
		sendKeys(Username);
		sendKeys(FirstNameNULL);
		sendKeys(LastName);
		sendKeys(Password);
		sendKeys(Password);
		sendKeys(Email);
		sendKeys(Email);
		sendKeys("ENTER");
		
		
	}
	public void testRegesterNullLName(){
		sendKeys(Username);
		sendKeys(FirstName);
		sendKeys(LastNameNULL);
		sendKeys(Password);
		sendKeys(Password);
		sendKeys(Email);
		sendKeys(Email);
		sendKeys("ENTER");
		
		
	}
	public void testRegesterNullEmail(){
		sendKeys(Username);
		sendKeys(FirstName);
		sendKeys(LastName);
		sendKeys(Password);
		sendKeys(Password);
		sendKeys(EmailNULL);
		sendKeys(EmailNULL);
		sendKeys("ENTER");		
	}
	
	private static final String UsernameIllegal = "@ * ( ) ENTER ";
	private static final String PasswordIllegal = "@ * ( ) ENTER ";
	private static final String FirstNameIllegal = "@ * ( ) ENTER ";
	private static final String LastNameIllegal = "@ * ( ) ENTER ";
	private static final String EmailIllegal = "J O C O R C O S ENTER ";
	public void testRegesterIllegalValues(){
		sendKeys(UsernameIllegal);
		sendKeys(FirstNameIllegal);
		sendKeys(LastNameIllegal);
		sendKeys(PasswordIllegal);
		sendKeys(PasswordIllegal);
		sendKeys(EmailIllegal);
		sendKeys(EmailIllegal);
		sendKeys("ENTER");
		
		
	}
	
	public void testRegesterIllegalUser(){
		sendKeys(UsernameIllegal);
		sendKeys(FirstName);
		sendKeys(LastName);
		sendKeys(Password);
		sendKeys(Password);
		sendKeys(Email);
		sendKeys(Email);
		sendKeys("ENTER");

	}
	
	public void testRegesterIllegalPass(){
		sendKeys(Username);
		sendKeys(FirstName);
		sendKeys(LastName);
		sendKeys(PasswordIllegal);
		sendKeys(PasswordIllegal);
		sendKeys(Email);
		sendKeys(Email);
		sendKeys("ENTER");
		
		
	}

	public void testRegesterIllegalFName(){
		sendKeys(Username);
		sendKeys(FirstNameIllegal);
		sendKeys(LastName);
		sendKeys(Password);
		sendKeys(Password);
		sendKeys(Email);
		sendKeys(Email);
		sendKeys("ENTER");
		
		
	}
	
	public void testRegesterIllegalLName(){
		sendKeys(Username);
		sendKeys(FirstName);
		sendKeys(LastNameIllegal);
		sendKeys(Password);
		sendKeys(Password);
		sendKeys(Email);
		sendKeys(Email);
		sendKeys("ENTER");
		
		
	}
	
	public void testRegesterIllegalEmail(){
		sendKeys(Username);
		sendKeys(FirstName);
		sendKeys(LastName);
		sendKeys(Password);
		sendKeys(Password);
		sendKeys(EmailIllegal);
		sendKeys(EmailIllegal);
		sendKeys("ENTER");
		
		
	}
	
}
